﻿=== Introduction ===

These tools are used to translate the game "Dragon Ball Z - Super Gokuu Den Totsugeki Hen".

They only work with a headerless ROM and it must have the following checksums:

CRC32:   D531289B
MD5:     8BD89634D1B2205B1E7EF016485C0076
SHA-1:   926B861734CDEEF9E70CD436BE62C73481E7392F
SHA-256: CCA171C69DE8FD0AC2BDDAA492018A58FACCA64EBC4E760BCDC89C17F5B4AB4D

Take note that in some GoodSnes ROM sets, the name of the games "Dragon Ball Z - Super Gokuu Den Totsugeki Hen" and "Dragon Ball Z - Super Gokuu Den Kakusei Hen" have been exchanged.

=== Files ===

Tools-Readme-*.txt
  Explanations for the installation and use of the tools.

Script-ReadMe-*.txt
  Explanations for the different script files of the game.

Makefile
  File used by "make" to automate the building and insertion process.

gb{.exe}
2x1bpp{.exe}
4x1bpp{.exe}
  .bmp extraction and insertion programs for Linux and Windows (32 bits).

gb.c
2x1bpp.c
4x1bpp.c
  Source files for the programs mentioned above.

common.inc
*.wsm
  Assembly hacks source files.

asmhacks.wlk
  File used by "wlalink" to link the assembly hacks to the ROM.

codec.ss
  Racket source file for the compressor and decompressor.

dumper.ss
  Racket source file for the script dumper.

inserter.ss
  Racket source file for the script inserter.

libs/*.ss
  Racket libraries used by the programs mentioned above.

*-mod.dump
  Insertion control files modified to work with the assembly hacks.

*.tbl
  Conversion tables for dumping and inserting the script.

data-jp/*.bmp
  Original game graphics.

data-temp/*.bmp
  Examples of modified graphics that could be inserted.

data-temp/font.bmp
  Example of a font that could be inserted.

data-temp/font.wid
  File that contains the example font (font.bmp) character widths.

data-temp/*-ex.txt
  Examples of translated scripts for the menus that could be inserted.

=== Installation ===

Extract the archive making sure that you preserve the file tree structure.

The following tools are mandatory to be able to use these tools:

GNU Make: http://gnuwin32.sourceforge.net/packages/make.htm (for Windows)
Racket: https://download.racket-lang.org/
WLADX: http://www.villehelin.com/wla.html

On Linux, start by checking your distribution package manager for these tools. GNU Make should be available on every distributions in the development tools section.

You may need to install the Visual C++ redistributable dlls to make the WLADX tools on Windows.

Optionally, you will need a C compiler if you want to recompile the .bmp extraction and insertion programs.

On Windows, make sure you put "make.exe" and its DLLs, "wla-65816.exe" and "wlalink.exe" in your executable PATH or in this folder with the other tools.

To generate "codec" and "inserter" executables, You need to open "codec.ss" and "inserter.ss" in DrRacket and select the "Create Executable..." command in the "Racket" menu and click "Create".

Place your Super Gokūden 1 ROM in this folder with the name "dbz-sgth-orig.smc" or change "Makefile", "Background.wsm" and "dumper.ss" to put in the name you have chosen.

It is recommended that you copy or rename the "data-temp" folder to "data-<language>" where <language> is the code for the language you will be translating to, e.g. fr, en, es, etc.

If you follow this recommendation, you will need to change the "LANGUAGE" variable in the "Makefile" and the "language" variable in the "inserter.ss" file.

Before you can insert the script, you need to execute "dumper.ss" (click the "Run" button in DrRacket while the file is opened) at least once in order to create certain files necessary for the inserter.

After this step, the original Japanese script files can be found in the "data-jp" folder (data-jp/*.txt). Copy or move these files to the "data-<language>" folder. These are the files you will be translating.

The text for Gokū's status bar in battle is hard-coded in the assembly code in the data-<language>/Battle-tr.wsm" file.

=== Configuration ===

Makefile

The ROM variable contains the original ROM name.

The LANGUAGE variable contains the language code.

The CXX variable contains the name of the C compiler.

The CXXFLAGS variable contains the options to give to the C compiler.

The WLA_FLAGS variable contains the options to give to the assembler. If ENABLE_DEBUG_MENU is set to 0, the debug menu is disabled, if it is set to 1, it is enabled. If ENABLE_RELEASE is set to 0, the free space locations in the ROM are filled with zeroes for testing, if it is set to 1, they are not modified which gives a smaller patch.

dumper.ss

The rom-name variable defined at the top of the file contains the original ROM name.

inserter.ss

The language variable defined at the top of the file contains the language code.

The char-widths-file variable defined at the top of the file contains the name of the file that contains the character widths for the font

The bottom of the file contains the calls to the "insert-script" function.

The fourth argument of the function is the name of the translated file to insert.

The fifth argument is optional and when it is present, it is the name of the log file where the addresses where the strings were inserted will be written or #f (false) to indicate that you don’t want a log file.

=== Precautions ===

The .bmp file insertion programs are very picky. You need to make sure that the image edition program that you use does not change the number of colors or their emplacements in the palette.

=== Execution ===

Open a command line window and navigate to the project folder, type "make <language>", the command will finish after 15 to 20 seconds. The translated ROM will be named "dbz-sgth-<language>.smc". If you are not familiar with the command line, you can also create a batch file in the project folder with the following contents:

===== Windows: make.bat =====
@echo off
make <language>
pause

===== Linux: make.sh =====
#!/bin/sh
make <language>
read -s

And execute it to rebuild the ROM.

After that, if you do not modify the assembly hacks, graphics or the font, you can just execute "inserter.ss" in DrRacket or execute the "inserter" program to insert the script without having to rebuild the ROM.

=== Change Log ===

Version 2.0
  File reorganization.
  Updated PLT-Scheme -> Racket.
  Updated documentation.
  Added English documentation.

Version 1.0
  Private release.


